import 'package:flutter/material.dart';

class LayoutCase extends StatelessWidget {
  const LayoutCase({super.key});
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
      Container(
        width: 300,
        height: 100,
        decoration: const BoxDecoration(
          color: Colors.red,
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,//主轴
          crossAxisAlignment: CrossAxisAlignment.center,//交叉轴
          children: [
          Image.asset('assets/open_eyes.png',
          width: 50,
          height: 50,
          ),
          Image.asset('assets/open_eyes.png',
          width: 50,
          height: 50,
          ),
          Image.asset('assets/open_eyes.png',
          width: 50,
          height: 50,
          ),
          ],
        ),
      ),
      Column(children: [
        Image.network('https://ts1.tc.mm.bing.net/th?id=ORMS.91546991bf31f397a59c6499c017c655&pid=Wdp&w=612&h=304&qlt=90&c=1&rs=1&dpr=1.3499999046325684&p=0',
        width: 100,
        height: 100,
        ),
const SizedBox(
  height: 10,
),//通过盒子设置间距
const Text('闰土'),
const Padding(
  padding: EdgeInsets.all(8.0),
  child: Text('我是闰土'),
)
      ],),
      Container(
        width: double.infinity,//宽度占比100%
        height: 60,//高度固定为120
        decoration: const BoxDecoration(
          color: Colors.blue,
        ),
        child: Row(children: [
          ClipRRect(
            borderRadius: BorderRadius.circular(2),
            child: Image.network('https://ts1.tc.mm.bing.net/th?id=ORMS.91546991bf31f397a59c6499c017c655&pid=Wdp&w=612&h=304&qlt=90&c=1&rs=1&dpr=1.3499999046325684&p=0',
            width: double.infinity,
            fit: BoxFit.cover,            ),
          ),
          const SizedBox(
            width: 10,
          ),
          Expanded(
            flex: 1,//沾满主轴剩余空间，类似鸿蒙 .layoutweight（1）
            child: Container(
              height: double.infinity,//100%
              color: Colors.yellow,
              child: const Text('闰土'),
            ),
          )
        ],),
      )
      ],
    );
  }
}